import request from '@/utils/request'

// 查询抽奖活动列表
export function listLottery(query) {
  return request({
    url: '/activity/lottery/list',
    method: 'get',
    params: query
  })
}

// 查询抽奖活动详细
export function getLottery(lotteryUid) {
  return request({
    url: '/activity/lottery/' + lotteryUid,
    method: 'get'
  })
}

// 新增抽奖活动
export function addLottery(data) {
  return request({
    url: '/activity/lottery',
    method: 'post',
    data: data
  })
}

// 修改抽奖活动
export function updateLottery(data) {
  return request({
    url: '/activity/lottery',
    method: 'put',
    data: data
  })
}
export function updateStatus(lotteryUid,lotteryStatus) {
  const data = {
    lotteryUid,
    lotteryStatus
  }

  return request({
    url: '/activity/lottery/updateStatus',
    method: 'put',
    data: data
  })
}

// 删除抽奖活动
export function delLottery(lotteryUid) {
  return request({
    url: '/activity/lottery/' + lotteryUid,
    method: 'delete'
  })
}
